css html attribut

40

<div class='dynamic-color' data-assigned-color='red'>lorem ipsum</div>
<div class='dynamic-color' data-assigned-color='blue'>lorem ipsum</div>
<div class='dynamic-color' data-assigned-color='green'>lorem ipsum</div>

.dynamic-color {
    color: [data-assigned-color];
}

Comments

Submit
0 Comments